package com.wlsk.license.common.enums;

import lombok.Getter;

@Getter
public enum PlateRetEnum {
    // 可自己添加常用状态
    SUCCESS(200, "成功"),
    FAILED(900, "失败"),
    PARAM_ERROR(400, "参数异常");
    private Integer code;
    private String msg;

    PlateRetEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static boolean isSuccess(Integer code) {
        if (code == null) {
            return false;
        }
        return PlateRetEnum.SUCCESS.getCode().equals(code);
    }

    public static boolean isFailed(Integer code) {
        return !PlateRetEnum.isSuccess(code);
    }
}